import Vue from 'vue'
import Router from 'vue-router'
import EnterpriseCertification from '@/framework/mobile/views/certification/enterpriseCertification'//企业认证
import SmallAuthentication  from '@/framework/mobile/views/smallAuthentication/index'//小额鉴权
import Error  from '@/framework/mobile/views/error/index'
Vue.use(Router)

let router = new Router({
  routes: [
		{
		  path: '/tips',
		  name: 'Error',
		  component: Error
		},
		 {
		  path: '/enterpriseCertification',
		  name: 'EnterpriseCertification',
		  component: EnterpriseCertification
		},
		 {
		  path: '/smallAuthentication',
		  name: 'SmallAuthentication',
		  component: SmallAuthentication
		}
  ]
})

/**
 * 验证
 */
router.beforeEach((to, from, next) => {
  if (!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
    window.location.href = '/p_index.html#/'
    return
  }
  next()
})
router.afterEach((to, from, next) => {
	window.scrollTo(0, 0);
});
export default router
